'use strict';

import { activityModel } from "../model/activity";
import { ServiceBase, Exceptions } from '../kalend';

class ActivityService extends ServiceBase {
    constructor() {
        super(activityModel)
    }
    async query(params: any) {
        let res=this.queryAll({
        filter: { status: 1},
        select: 'img title type hrefurl'});
        return res;
    }
    async save(doc: any) {
        if (doc._id) {
            this.update(doc._id, doc);
        } else {
            this.create(doc);
        }
        return '保存成功';
    }
}

export const activityService = new ActivityService();